package cn.hd.service.impl;

import cn.hd.dao.ReturnDao;
import cn.hd.entity.Productdetail;
import cn.hd.entity.Returnn;
import cn.hd.service.ReturnService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class ReturnImpl implements ReturnService {
    @Autowired
    private ReturnDao returnDao;

    @Override
    public int addReturn(Returnn returnn) {
        return returnDao.addReturn(returnn);
    }

    @Override
    public int delReturnn(long returnid) {
        return returnDao.delReturnn(returnid);
    }

    @Override
    public int updateReturn(Returnn returnn) {
        return returnDao.updateReturn(returnn);
    }

    @Override
    public Returnn selectByIdReturn(long returnid) {
        return returnDao.selectByIdReturn(returnid);
    }

    @Override
//    public PageInfo<Returnn> selectReturn(int pagenum, int pagesize,long pid) {
        public List<Returnn> selectReturn(long pid){

//        PageHelper.startPage(pagenum,pagesize);
        List<Returnn> returns = returnDao.selectReturn(pid);
//        PageInfo<Returnn> page=new PageInfo<>(returns);
        return returns;
    }

    @Override
    public List<Returnn> selectReturnById(long pid) {
        List<Returnn> returns = returnDao.selectReturn(pid);
        return returns;
    }


}
